<?php

namespace app\merchant\controller\data;

use app\merchant\controller\Base;
use app\merchant\model\Goods as GoodsModel;
use app\merchant\model\Category as CategoryModel;

/**
 * 商品数据控制器
 * Class Goods
 * @package app\store\controller\data
 */
class Goods extends Base
{

    /**
     * 商品列表
     * @return mixed
     * @throws \think\exception\DbException
     */
    public function lists()
    {
        $model = new GoodsModel;
        // 商品分类
        $catgory = CategoryModel::getCacheTree();
        // 商品列表
        $list = $model->getList($this->request->param());
        return $this->renderSuccess(compact('list', 'catgory'),"查询成功");
    }

}
